package com.service;

import com.dao.BlogDao;
import com.dao.BlogDaoImpl;
import com.entity.Blog;
import com.util.PageUtil;

import java.util.List;

/**
 * @Description TODO
 * @Author hyl
 * @Date 2022/6/25 10:10
 **/
public class BlogServiceImpl implements BlogService {
	BlogDao blogDao = new BlogDaoImpl();

	@Override
	public List<Blog> findByPage1(PageUtil pageUtil) {
		return blogDao.findByPage(pageUtil);
	}

	@Override
	public int findPageCount() {
		return blogDao.findPageCount();
	}

	@Override
	public void findByPage(PageUtil pageUtil) {
		List<Blog> list = blogDao.findByPage(pageUtil); //显示的数据
		int totalSize = blogDao.findPageCount(); //总行数

		pageUtil.setShowList(list);
		pageUtil.setTotalSize(totalSize);
	}
}
